#pragma once

#define INITGUID

#include "engineobject.h"
#include "d3dx10.h"
#include "IEngineComponent.h"

#pragma comment(linker, "/INCLUDE:??0PointLightComponent@@QAE@XZ")

// {EF59BCAA-6ACF-483b-9771-B1BF1C16D46A}
DEFINE_GUID(POINT_LIGHT_COMPONENT_GUID, 
0xef59bcaa, 0x6acf, 0x483b, 0x97, 0x71, 0xb1, 0xbf, 0x1c, 0x16, 0xd4, 0x6a);

class PointLightComponent :
	public IEngineComponent
{
public:
	PointLightComponent();
	PointLightComponent(D3DXVECTOR3 position, D3DXVECTOR3 color, float radius, float intensity);
	~PointLightComponent(void);

	GUID getSystemIdentifier();
	GUID getComponentIdentifier();
	D3DXVECTOR3 getPosition();
	void setPosition(D3DXVECTOR3 position);
	D3DXVECTOR3 getColor();
	void setColor(D3DXVECTOR3 color);
	float getRadius();
	void setRadius(float radius);
	float getIntensity();
	void setIntensity(float intensity);
	D3DXMATRIX getWorld();

	void Serialize(EnginePointer<ISerializerWriteContext>& context, char* name);
	static IEngineComponent* Deserialize(EnginePointer<ISerializerReadContext>& context);

	AUTO_SIZE;
private:
	D3DXVECTOR3 position;
	D3DXVECTOR3 color;
	float radius;
	float intensity;
};
